package com.google.code.easyparking.controleur;


import com.google.code.easyparking.metier.IParking;
import com.google.code.easyparking.metier.LogParking;
import com.google.code.easyparking.metier.Parking;

public class ControleurParking implements IControleurParking {
	
	private final IParking parking ;
	
	/**
	 * Constructeur par defaut
	 */
	public ControleurParking(String nom, int nbPlacesTotal,int  nbEntrees) {
		parking = new Parking(nom, nbPlacesTotal, nbEntrees);
	}
	

	public IParking getParking() {
		return parking;
	}

	@Override
	public int getNbPLacesLibres() {
		return parking.getNbPlacesLibre();
	}

	@Override
	public String getNom() {
		return parking.getNom();
	} 

	@Override
	public void setClosed(boolean openClosed) {
		// TODO Auto-generated method stub
	}
	
	public void getLogEvent() {
		for (LogParking logParking : parking) {
			System.out.println(logParking.toString());
		}
		
	}


	@Override
	public int getNbLogEvent() {
		return parking.getNbLogEvent();
	}
}
